Repository navigation
Fix: don't respond to mouse drag events that started outside of our nodes window - #238
Closed
JulesFouchy wants to merge 1 commit into
Closed
JulesFouchy wants to merge 1 commit into
JulesFouchy wants to merge 1 commit into
Conversation
thedmd
added a commit
that referenced
this pull request
Oct 14, 2026
…238) A right-drag that started in another window panned the editor as soon as the mouse entered it, since a pan only needed the button dragging and the editor focused and hovered. A pan now also needs the press to have made the editor's background or one of its objects the active item. Co-authored-by: Jules Fouchy <jules.fouchy@ntymail.com>
Owner
|
Thank you @JulesFouchy! I reproduced it, and fixed it a bit differently: a pan now needs the press to have made the editor's background or one of its objects the active item, so a drag that started elsewhere never pans. It's in v0.9.4 as 4e2a6a3, with you as co-author. Closing. |
pthom
added a commit
to pthom/imgui-node-editor
that referenced
this pull request
Oct 15, 2026
…tton Since the fix of thedmd#238, a pan needs the press to make the background or an object active. A press on a widget of a node (a button, which uses the left mouse button) made neither: the view did not pan. The background now takes a press of the navigate button inside the editor that no item owns (SetKeyOwner(), until release): - a drag from such a widget pans; - a widget that uses the navigate button owns it, and keeps it; - a drag pressed outside the editor still does not pan (thedmd#238). Needs Dear ImGui 1.90.7 (ImGuiKeyOwner_NoOwner). With an older one, nothing changes.
pthom
added a commit
to pthom/imgui-node-editor
that referenced
this pull request
Oct 15, 2026
- from the background, and from a button of a node: the view pans; - from a widget that uses the navigate button: it keeps the button, the view does not pan; - from outside the editor: no pan when the drag enters it (thedmd#238).
pthom
added a commit
to pthom/imgui-node-editor
that referenced
this pull request
Oct 16, 2026
…tton Since the fix of thedmd#238, a pan needs the press to make the background or an object active. A press on a widget of a node (a button, which uses the left mouse button) made neither: the view did not pan. Now a press of the navigate button inside the editor that no item owns is remembered: - once the mouse drags, the background takes the button until its release (SetKeyOwner()), and the view pans; - a click stays a click: the context menus of the widget and of its node open, as before; - a widget that uses the navigate button owns it, and keeps it; - the release that ends a pan is locked for its frame: no context menu opens under the mouse; - a drag pressed outside the editor still does not pan (thedmd#238). Needs Dear ImGui 1.90.7 (ImGuiKeyOwner_NoOwner). With an older one, nothing changes.
pthom
added a commit
to pthom/imgui-node-editor
that referenced
this pull request
Oct 16, 2026
- from the background, and from a button of a node: the view pans; - from a widget that uses the navigate button: it keeps the button, no pan; - from outside the editor: no pan (thedmd#238); - a right click on a button of a node: its context menu and the node's, as before; - a pan that ends on the button it started from: no context menu.
pthom
added a commit
to pthom/imgui-node-editor
that referenced
this pull request
Oct 16, 2026
…tton Since the fix of thedmd#238, a pan needs the press to make the background or an object active. A press on a widget of a node (a button, which uses the left mouse button) made neither: the view did not pan. Now a press of the navigate button inside the editor that no item owns is remembered: - once the mouse drags, the background takes the button until its release (SetKeyOwner()), and the view pans; - a click stays a click: the context menus of the widget and of its node open, as before; - a widget that uses the navigate button owns it, and keeps it; - the release that ends a pan is locked for its frame: no context menu opens under the mouse; - a drag pressed outside the editor still does not pan (thedmd#238). Needs Dear ImGui 1.90.7 (ImGuiKeyOwner_NoOwner). With an older one, nothing changes.
pthom
added a commit
to pthom/imgui-node-editor
that referenced
this pull request
Oct 16, 2026
- from the background, and from a button of a node: the view pans; - from a widget that uses the navigate button: it keeps the button, no pan; - from outside the editor: no pan (thedmd#238); - a right click on a button of a node: its context menu and the node's, as before; - a pan that ends on the button it started from: no context menu.
pthom
added a commit
to pthom/imgui-node-editor
that referenced
this pull request
Oct 16, 2026
…tton Since the fix of thedmd#238, a pan needs the press to make the background or an object active. A press on a widget of a node (a button, which uses the left mouse button) made neither: the view did not pan. Now a press of the navigate button inside the editor that no item owns is remembered: - once the mouse drags, the background takes the button until its release (SetKeyOwner()), and the view pans; - a click stays a click: the context menus of the widget and of its node open, as before; - a widget that uses the navigate button owns it, and keeps it; - the release that ends a pan is locked for its frame: no context menu opens under the mouse; - a drag pressed outside the editor still does not pan (thedmd#238). Needs Dear ImGui 1.89 (input ownership). With an older one, nothing changes.
pthom
added a commit
to pthom/imgui-node-editor
that referenced
this pull request
Oct 16, 2026
- from the background, and from a button of a node: the view pans; - from a widget that uses the navigate button: it keeps the button, no pan; - from outside the editor: no pan (thedmd#238); - a right click on a button of a node: its context menu and the node's, as before; - a pan that ends on the button it started from: no context menu. The pan from a button, and the end of a pan, need the fix: skipped before Dear ImGui 1.89.
pthom
added a commit
to pthom/imgui-node-editor
that referenced
this pull request
Oct 16, 2026
…tton Since the fix of thedmd#238, a pan needs the press to make the background or an object active. A press on a widget of a node (a button, which uses the left mouse button) made neither: the view did not pan. Now a press of the navigate button inside the editor that no item owns is remembered: - once the mouse drags, the background takes the button until its release (SetKeyOwner()), and the view pans; - a click stays a click: the context menus of the widget and of its node open, as before; - a widget that uses the navigate button owns it, and keeps it; - the release that ends a pan is locked for its frame: no context menu opens under the mouse; - a drag pressed outside the editor still does not pan (thedmd#238). Needs Dear ImGui 1.89 (input ownership). With an older one, nothing changes.
pthom
added a commit
to pthom/imgui-node-editor
that referenced
this pull request
Oct 16, 2026
- from the background, and from a button of a node: the view pans; - from a widget that uses the navigate button: it keeps the button, no pan; - from outside the editor: no pan (thedmd#238); - a right click on a button of a node: its context menu and the node's, as before; - a pan that ends on the button it started from: no context menu. The pan from a button, and the end of a pan, need the fix: skipped before Dear ImGui 1.89.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
When you start dragging the mouse in a window not related to the nodes, and then hover the nodes window while dragging, the nodes view starts panning:
This PR fixes it and only allows drag events that started in the nodes window to affect the nodes view: